<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<layout:page>

<jsp:body>
	<h2>Empréstimo de Materiais</h2>
	
    <table class="list">
        <tbody>
		<tr>
            <th width="15%"></th>
            <th>
                Tipo
            </th>
            <th>
            	Título
            </th>
        </tr>
		<c:if test="${!empty ListaMateriais}">
		<c:forEach items="${ListaMateriais}" var="material">
        <tr>
            <td>
                <a href="/EmprestarMaterial?id=${material.id} }">Emprestar</a>

            </td>
            <td>
                ${material.tipo}
            </td>
            <td>
                ${material.titulo}
            </td>
        </tr>
        </c:forEach>
        </c:if>
        
		<c:if test="${empty ListaMateriais}">
			<tr>
				<td colspan="3" align="center">Nenhum material encontrado</td>
			</tr>
		</c:if>

    	</tbody>
    </table>
</jsp:body>   

</layout:page>